package com.payment.service.impl;

import com.payment.bean.Payment;
import com.payment.mapper.PaymentDao;
import com.payment.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Description:
 *
 * @author weiruibai.vendor
 * Date: 2022/12/12 17:36
 */
@Service
public class PaymentServiceImpl implements PaymentService {

    @Autowired
    private PaymentDao paymentDao;

    @Override
    public String add(Payment payment) {
        if (null == payment.getCreateAt()){
            payment.setCreateAt(new Date());
        }
        return paymentDao.add(payment) + "";
    }

    @Override
    public Payment get(int id) {
        return paymentDao.get(id);
    }

    @Override
    public List<Payment> getList() {
        return paymentDao.getList();
    }

}
